package ${basePackage}<#if subPackage??>.${subPackage}</#if>;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.hare.service.dto.req.ApiReqDto;
import com.hare.service.annotation.ApiField;
import com.hare.service.processor.GroupOneMustBeFilledInProcessor;

import java.util.List;
import javax.validation.constraints.NotNull;

/**
* @author: GenUtil
* @date: ${dateTime}
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel("${apiModel}")
public class ${className} extends ApiReqDto {

<#if fields??>
    <#list fields as field>
        <#if field.fieldName=='id' || field.fieldName=='name' || field.fieldName=='keyword'>
    @ApiField(value = "${field.apiModelProperty}", <#if field.required>necessity = true, </#if>group = GroupOneMustBeFilledInProcessor.class)
    @NotNull(message = "${field.message}")
        <#else>
            <#if field.required>
    @ApiField(value = "${field.apiModelProperty}", necessity = true)
            <#else>
    @ApiField("${field.apiModelProperty}")
            </#if>
        </#if>
    @JsonProperty("${field.fieldName}")
    @ApiModelProperty(name = "${field.apiModelProperty}", example = "${field.exampleValue}")
    private <#if field.list>${field.classNameWithType}<#else>${field.className}</#if> ${field.fieldName};

    </#list>
</#if>
}
